chrome.runtime.onMessage.addListener(
  function(request, sender, sendResponse) {
    console.log(sender.tab ?
                "from a content script:" + sender.tab.url :
                "from the extension");
    if (request == "get_img")
    var imgScrs="";
    var imgs = document.getElementsByTagName("img");
    for(var i=0;i<imgs.length;i++){
      imgScrs+=imgs [i].src;
    if(i+1<imgs.length)
      imgScrs+="|";
    }

        sendResponse(imgScrs.toString());
  });